/*
 * Created by JFormDesigner on Mon Dec 19 13:43:52 CST 2022
 */

package view.menu;

import java.awt.*;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;

import com.jgoodies.forms.factories.*;

/**
 * @author 1
 */
public class NormalUserMenuView extends JFrame {
    public NormalUserMenuView() {
        initComponents();
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
        Menu = new JPanel();
        userMenu = new JTabbedPane();
        bookMenu = new JPanel();
        panel4 = new JPanel();
        label2 = compFactory.createLabel("\u56fe\u4e66id:");
        bookId = new JTextField();
        label3 = compFactory.createLabel("\u56fe\u4e66\u540d\u79f0\uff1a");
        bookName = new JTextField();
        label5 = compFactory.createLabel("\u56fe\u4e66\u4f5c\u8005\uff1a");
        bookAuthor = new JTextField();
        label6 = compFactory.createLabel("\u51fa\u7248\u793e\uff1a");
        bookPre = new JTextField();
        s = compFactory.createLabel("\u72b6\u6001\uff1a");
        state = new JPanel();
        noOut = new JRadioButton();
        hadOut = new JRadioButton();
        scrollPane1 = new JScrollPane();
        // 表头（列名）
        Object[] bookColumnNames = {"Id", "图书名称", "作者","出版社","状态"};

        bookModel = new DefaultTableModel(bookRowData, bookColumnNames) {
            @Override
            public boolean isCellEditable(int row, int column) { // 表格不可编辑
                return false;
            }
        };
        bookTable=new JTable(bookModel);
        panel6 = new JPanel();
        bookShow = new JButton();
        bookSearch = new JButton();
        bookBorrow = new JButton();
        bookF5 = new JButton();
        myBorrow = new JPanel();
        scrollPane2 = new JScrollPane();
        Object[] recordColumnNames = {"Id", "图书id", "用户id","借出时间","归还时间"};
        recordModel = new DefaultTableModel(recordRowData, recordColumnNames) {
            @Override
            public boolean isCellEditable(int row, int column) { // 表格不可编辑
                return false;
            }
        };
        recordTable = new JTable(recordModel);
        panel9 = new JPanel();
        bookRenew = new JButton();
        bookReturn = new JButton();

        //======== this ========
        setMinimumSize(new Dimension(735, 600));
        setTitle("\u7528\u6237\u83dc\u5355");
        Container contentPane = getContentPane();
        contentPane.setLayout(new BorderLayout());

        //======== Menu ========
        {
            Menu.setLayout(new BorderLayout());

            //======== userMenu ========
            {
                userMenu.setFont(userMenu.getFont().deriveFont(userMenu.getFont().getSize() + 5f));

                //======== bookMenu ========
                {
                    bookMenu.setLayout(new BorderLayout());

                    //======== panel4 ========
                    {
                        panel4.setLayout(new GridLayout(5, 2, 0, 70));

                        //---- label2 ----
                        label2.setFont(label2.getFont().deriveFont(label2.getFont().getSize() + 10f));
                        label2.setHorizontalAlignment(SwingConstants.CENTER);
                        panel4.add(label2);
                        panel4.add(bookId);

                        //---- label3 ----
                        label3.setHorizontalAlignment(SwingConstants.CENTER);
                        label3.setFont(label3.getFont().deriveFont(label3.getFont().getSize() + 10f));
                        panel4.add(label3);
                        panel4.add(bookName);

                        //---- label5 ----
                        label5.setHorizontalAlignment(SwingConstants.CENTER);
                        label5.setFont(label5.getFont().deriveFont(label5.getFont().getSize() + 10f));
                        panel4.add(label5);
                        panel4.add(bookAuthor);

                        //---- label6 ----
                        label6.setHorizontalAlignment(SwingConstants.CENTER);
                        label6.setFont(label6.getFont().deriveFont(label6.getFont().getSize() + 10f));
                        panel4.add(label6);
                        panel4.add(bookPre);

                        //---- s ----
                        s.setHorizontalAlignment(SwingConstants.CENTER);
                        s.setFont(s.getFont().deriveFont(s.getFont().getSize() + 10f));
                        panel4.add(s);

                        //======== state ========
                        {
                            state.setLayout(new GridLayout(1, 2));

                            //---- noOut ----
                            noOut.setText("可借   ");
                            noOut.setFont(noOut.getFont().deriveFont(noOut.getFont().getSize() + 5f));
                            state.add(noOut);

                        }
                        panel4.add(state);
                    }
                    bookMenu.add(panel4, BorderLayout.WEST);

                    //======== scrollPane1 ========
                    {

                        //---- bookList ----
                        bookTable.setFont(bookTable.getFont().deriveFont(bookTable.getFont().getSize() + 5f));
                        scrollPane1.setViewportView(bookTable);
                    }
                    bookMenu.add(scrollPane1, BorderLayout.CENTER);

                    //======== panel6 ========
                    {
                        panel6.setLayout(new GridLayout(2, 4, 10, 0));

                        //---- bookShow ----
                        bookShow.setText("\u663e\u793a\u6240\u6709");
                        bookShow.setFont(bookShow.getFont().deriveFont(bookShow.getFont().getSize() + 5f));
                        panel6.add(bookShow);

                        //---- bookSearch ----
                        bookSearch.setText("\u67e5\u8be2");
                        bookSearch.setFont(bookSearch.getFont().deriveFont(bookSearch.getFont().getSize() + 5f));
                        panel6.add(bookSearch);

                        //---- bookBorrow ----
                        bookBorrow.setText("\u501f\u9605");
                        bookBorrow.setFont(bookBorrow.getFont().deriveFont(bookBorrow.getFont().getSize() + 5f));
                        panel6.add(bookBorrow);

                        //---- bookF5 ----
                        bookF5.setText("\u5237\u65b0");
                        bookF5.setFont(bookF5.getFont().deriveFont(bookF5.getFont().getSize() + 5f));
                        bookF5.setMinimumSize(new Dimension(2000, 600));
                        panel6.add(bookF5);
                    }
                    bookMenu.add(panel6, BorderLayout.SOUTH);
                }
                userMenu.addTab("\u56fe\u4e66\u501f\u9605", bookMenu);

                //======== myBorrow ========
                {
                    myBorrow.setLayout(new BorderLayout());

                    //======== scrollPane2 ========
                    {

                        //---- userList ----
                        recordTable.setFont(recordTable.getFont().deriveFont(recordTable.getFont().getSize() + 5f));
                        scrollPane2.setViewportView(recordTable);
                    }
                    myBorrow.add(scrollPane2, BorderLayout.CENTER);

                    //======== panel9 ========
                    {
                        panel9.setLayout(new GridLayout(2, 4, 10, 0));

                        //---- bookRenew ----
                        bookRenew.setText("\u7eed\u501f");
                        bookRenew.setFont(bookRenew.getFont().deriveFont(bookRenew.getFont().getSize() + 5f));
                        panel9.add(bookRenew);

                        //---- bookReturn ----
                        bookReturn.setText("\u5f52\u8fd8");
                        bookReturn.setFont(bookReturn.getFont().deriveFont(bookReturn.getFont().getSize() + 5f));
                        bookReturn.setMinimumSize(new Dimension(2000, 600));
                        panel9.add(bookReturn);
                    }
                    myBorrow.add(panel9, BorderLayout.SOUTH);
                }
                userMenu.addTab("\u6211\u7684\u501f\u9605", myBorrow);
            }
            Menu.add(userMenu, BorderLayout.CENTER);
        }
        contentPane.add(Menu, BorderLayout.CENTER);
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    private JPanel Menu;
    private JTabbedPane userMenu;
    private JPanel bookMenu;
    private JPanel panel4;
    private JLabel label2;
    private JTextField bookId;
    private JLabel label3;
    private JTextField bookName;
    private JLabel label5;
    private JTextField bookAuthor;
    private JLabel label6;
    private JTextField bookPre;
    private JLabel s;
    private JPanel state;
    private JRadioButton noOut;
    private JRadioButton hadOut;
    private JScrollPane scrollPane1;
    private JTable bookTable;
    private JPanel panel6;
    private JButton bookShow;
    private JButton bookSearch;
    private JButton bookBorrow;
    private JButton bookF5;
    private JPanel myBorrow;
    private JScrollPane scrollPane2;
    private JTable recordTable;
    private JPanel panel9;
    private JButton bookRenew;
    private JButton bookReturn;
    private DefaultTableModel bookModel;
    private Object[][] bookRowData;
    private DefaultTableModel recordModel;
    private Object[][] recordRowData;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on

    public JPanel getMenu() {
        return Menu;
    }

    public JTabbedPane getUserMenu() {
        return userMenu;
    }

    public JPanel getBookMenu() {
        return bookMenu;
    }

    public JPanel getPanel4() {
        return panel4;
    }

    public JLabel getLabel2() {
        return label2;
    }

    public JTextField getBookId() {
        return bookId;
    }

    public JLabel getLabel3() {
        return label3;
    }

    public JTextField getBookName() {
        return bookName;
    }

    public JLabel getLabel5() {
        return label5;
    }

    public JTextField getBookAuthor() {
        return bookAuthor;
    }

    public JLabel getLabel6() {
        return label6;
    }

    public JTextField getBookPre() {
        return bookPre;
    }

    public JLabel getS() {
        return s;
    }


    public JRadioButton getNoOut() {
        return noOut;
    }

    public JRadioButton getHadOut() {
        return hadOut;
    }

    public JScrollPane getScrollPane1() {
        return scrollPane1;
    }

    public JTable getBookTable() {
        return bookTable;
    }

    public JPanel getPanel6() {
        return panel6;
    }

    public JButton getBookShow() {
        return bookShow;
    }

    public JButton getBookSearch() {
        return bookSearch;
    }

    public JButton getBookBorrow() {
        return bookBorrow;
    }

    public JButton getBookF5() {
        return bookF5;
    }

    public JPanel getMyBorrow() {
        return myBorrow;
    }

    public JScrollPane getScrollPane2() {
        return scrollPane2;
    }

    public JTable getRecordTable() {
        return recordTable;
    }

    public JPanel getPanel9() {
        return panel9;
    }

    public JButton getBookRenew() {
        return bookRenew;
    }

    public JButton getBookReturn() {
        return bookReturn;
    }

    public DefaultTableModel getBookModel() {
        return bookModel;
    }

    public Object[][] getBookRowData() {
        return bookRowData;
    }

    public DefaultTableModel getRecordModel() {
        return recordModel;
    }

    public Object[][] getRecordRowData() {
        return recordRowData;
    }
}
